// ObjectSet.cpp : Implementation of CObjectSet
#include "stdafx.h"
#include "GPSObjects.h"
#include "ObjectSet.h"

/////////////////////////////////////////////////////////////////////////////
// CObjectSet

STDMETHODIMP CObjectSet::InterfaceSupportsErrorInfo(REFIID riid)
{
	static const IID* arr[] = 
	{
		&IID_IObjectSet
	};
	for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
	{
		if (InlineIsEqualGUID(*arr[i],riid))
			return S_OK;
	}
	return S_FALSE;
}

STDMETHODIMP CObjectSet::RemoveAll()
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState())

	// TODO: Add your implementation code here
	for (int i=0;i<m_ObjectList.GetCount();i++)
	{
		IDispatch*p	= m_ObjectList.GetAt(m_ObjectList.FindIndex(i));
		if(!p)	continue;
		p->Release();
	}

	m_ObjectList.RemoveAll();
	m_CurObjIndex = 0;
	
	return S_OK;
}

STDMETHODIMP CObjectSet::DismissAll()
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState())

	// TODO: Add your implementation code here
	m_ObjectList.RemoveAll();
	m_CurObjIndex = 0;
	return S_OK;
}

STDMETHODIMP CObjectSet::Test()
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState())

	// TODO: Add your implementation code here

	return S_OK;
}
